
#ifndef CGRAPHICS_VIEW_H
#define CGRAPHICS_VIEW_H

#include <QtCore/QVariant>
#include <QtGui/QMouseEvent>
#include <QtGui/QGraphicsSceneMouseEvent>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QHeaderView>
#include <QtGui/QMainWindow>
#include <QtGui/QMenuBar>
#include <QtGui/QStatusBar>
#include <QtGui/QGraphicsView>
#include <QtGui/QWidget>
#include "mainscene.h"
#include "station.h"
#include "railway.h"
#include "cgraphicsview.h"

QT_BEGIN_NAMESPACE

class CGraphicsView:public QGraphicsView
{
	Q_OBJECT

protected:
	CMainScene   *m_scene;
public:
	CGraphicsView(QWidget * parent);
	~CGraphicsView(){delete(m_scene);};

	
protected:
	void mousePressEvent(QMouseEvent *);
	void mouseMoveEvent(QMouseEvent *);
	void mouseReleaseEvent(QMouseEvent *);
	void paintEvent(QPaintEvent *);
	void resizeEvent(QResizeEvent *);
	void drawBackground(QPainter *, const QRectF &);
	void setSlots();


private:
	void drawStations();
	void drawConnection(QPoint &p1, QPoint & p2);
	void addStation(const QPoint &);

public slots:
	void action_addstation(bool);
	void action_addconnection(bool);
	void action_addtrain(bool);

signals:
    void valueChanged(int);
};


QT_END_NAMESPACE

#endif // UI_TRAIN_PATH_H
